package com.example.demo.config;

import org.apache.activemq.command.ActiveMQQueue;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

import javax.jms.Queue;

/**
 * @AUTHOR LYF
 * @DATE 2022/2/13
 * @VERSION 1.0
 * @DESC
 */
@Component
public class QueueBean {
    @Value("${queue}")
    String queueName;
    @Bean
    Queue getQueue(){
        return new ActiveMQQueue(queueName);
    }
    public Queue createQueue(String queueName){
        return new ActiveMQQueue(queueName);
    }
}
